import http from "@/api/http";
import { tokenAdd } from "@/api/myExaminatonGaper";
const request = "/example-api";

//礼包商品
export function getBagIdItem(params) {
  return http.get(`${request}/api/bagitems/bagId=${params.bagId}`);
}
//获取地址
export function getAdressManagesAPI(params) {
  return http.get(`${request}/api/adressManages`, params);
}

//新增地址
export function postAdressManagesAPI(params) {
  return http.post(`${request}/api/adressManages`, params);
}

//修改地址
export function putAdressManagesAPI(params) {
  return http.put(`${request}/api/adressManages/${params.id}`, params);
}

//获取商品详情
export function getItems(params) {
  return http.get(`${request}/api/items/${params.id}`);
}

//获取总额
export function getSummary(params) {
  return http.get(`${request}/api/accounts/userId=${params.userId}/summary`);
}

//获取总额列表
export function getAccountItems(params) {
  return http.get(`${request}/api/accountitems`, params);
}

//奖池总奖励
export function getFttprofits(params) {
  return http.get(`${request}/api/fttprofits`, params);
}

//分红记录
export function getFttuserprofits(params) {
  return http.get(`${request}/api/fttuserprofits`, params);
}

//微信支付
export function postWxAppPay(params) {
  return http.post_t(`${request}/transaction/wxAppPay`, params);
}

//支付宝支付
export function postAlipay(params) {
  return http.post_t(`${request}/transaction/alipay`, params);
}

//获取登录信息
export function postLogin(params) {
  return http
    .post(`${request}/passport/accesstokens?grantType=ftt`, params)
    .then((res) => {
      tokenAdd({
        user_id: res.data.data.userId,
        token: res.data.data.accesstoken,
      });
    //   console.log(res.data, "res111");
      return res;
    });
}

//我的信息
export function getFttuserUserId(params) {
  return http.get(`${request}/api/fttusers/userId=${params.userId}`);
}

//我的团队
export function getReferralsummary(params) {
  return http.get(
    `${request}/api/fttusers/userId=${params.userId}/referralsummary`
  );
}

//团队列表
export function getFttusers(params) {
  return http.get(`${request}/api/fttusers`, params);
}

//网体归属码
export function getFttusersReferralCode(params) {
  return http.get(
    `${request}/api/fttusers/referralCode=${params.referralCode}`
  );
}

//网体归属提交
export function putFttusersParents(params) {
  return http.put(
    `${request}/api/fttusers/userId=${params.userId}/parents`,
    params
  );
}

//开卡校验
export function putFttusersZjcard(params) {
  return http.put(
    `${request}/api/fttusers/userId=${params.userId}/cardz`,
    params
  );
}

//订单列表
export function getOrders(params) {
  return http.get(`${request}/api/orders`, params);
}

//确认收货
export function putOrders(params) {
  return http.put(`${request}/api/orders/${params.id}/received`);
}

//已自提
export function putselfWithdrawal(params) {
  return http.put(`${request}/api/orders/${params.id}/selfWithdrawal`);
}

//分红大厅
export function getPartnerShares(params) {
  return http.get(`${request}/api/PartnerShares`, params);
}

//排名
export function getRank(params) {
  return http.get(`${request}/api/PartnerShares/${params.mobile}/rank`);
}

//图片
export function postImages(params) {
  return http.post_t(`${request}/api/images`, params);
}

//获取实名认证
export function getMemberidcards(params) {
  return http.get(`${request}/api/memberidcards/userId=${params.userId}`);
}

//修改实名认证
export function putMemberidcards(params) {
  return http.put(`${request}/api/memberidcards/${params.id}`, params);
}

//获取银行卡
export function getMemberbankcards(params) {
  return http.get(`${request}/api/memberbankcards`, params);
}

//添加银行卡
export function postMemberbankcards(params) {
  return http.post(`${request}/api/memberbankcards`, params);
}

//获取银行卡信息
export function getMemberbankcardsId(params) {
  return http.get(`${request}/api/memberbankcards/${params.id}`);
}

//修改银行卡信息
export function putMemberbankcardsId(params) {
  return http.put(`${request}/api/memberbankcards/${params.id}`, params);
}

//提现
export function postwithdraws(params) {
  return http.post(`${request}/api/withdraws`, params);
}

//获取提现列表
export function getwithdraws(params) {
  return http.get(`${request}/api/withdraws`, params);
}

//验证码
export function postVerificationcodes(params) {
  return http.post(`${request}/passport/verificationcodes`, params);
}

//周分红
export function getFtts(params) {
  return http.get(`${request}/api/ftts/summary`, params);
}

//获取userId排位
export function gePartnerSharescountMoney(params) {
  return http.get(`${request}/api/PartnerShares/${params.mobile}/countMoney`);
}

//转帐
export function postTransfer(params) {
  return http.post(`${request}/api/accounts/transfer`, params);
}
